﻿using IAOI.Platform.Common.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IAOI.Platform.Common.Diagnostics
{
    public static class Listener
    {
        private static IMessageListener messageListener = null;
        private static ITraceListener traceListener = null;

        static Listener()
        {
            string type = ConfigurationManager.Settings.MessageLogging.ListenerType;
            messageListener = Activator.CreateInstance(Type.GetType(type)) as IMessageListener;


            type = ConfigurationManager.Settings.Trace.ListenerType;
            traceListener = Activator.CreateInstance(Type.GetType(type)) as ITraceListener;
        }

        public static IMessageListener MessageListener
        {
            get
            {
                return messageListener;
            }
        }

        public static ITraceListener TraceListener
        {
            get
            {
                return traceListener;
            }
        }
    }
}
